home *** CD-ROM | disk | FTP | other *** search
/ Workbench Add-On / Workbench Add-On - Volume 1.iso / BBS-Archive / DiskUtil / Misc / BTNTape.lha / doc / usage.doc < prev    next >
Text File  |  1994-04-03  |  10KB  |  197 lines

  1. This section of the BTN documentation describes the basic techniques
  2. for using your tape drive with BTN.
  3.  
  4. ****    BTNtape:  an AmigaDOS handler for SCSI tape drives
  5. ****       Version 3.0   3/14/94
  6. ****       Freeware by Bob Rethemeyer   (drBob@cup.portal.com)
  7. ****    (c) Copyright 1990, 1994  Robert Rethemeyer.
  8.  
  9. CONTENTS
  10.      Tape file names
  11.      How to access tape data
  12.      Using TAR for backups and restores
  13.      Helpful hints
  14.      Fine tuning
  15.  
  16.  
  17. TAPE FILE NAMES
  18.  
  19.      BTN is compatible with AmigaDOS because you can use the name "TAPE:"
  20.      (or whatever) in most instances where a file or path name is required.
  21.      You CANNOT refer to files on the tape as "TAPE:filename", because
  22.      BTN does not support a file system.  But BTN does use some
  23.      characters to the right of the colon to determine access modes.
  24.  
  25.      Refer to the tape with one of the following file name forms:
  26.  
  27.      TAPE:R    Rewinds and opens the tape at the first available block.
  28.  
  29.      TAPE:NR   Opens the tape at the current position, without rewinding.
  30.      TAPE:*    Same as TAPE:NR (but doesn't work with some shells or commands)
  31.  
  32.      TAPE:     Same as TAPE:R or TAPE:NR, depending on NR startup parameter.
  33.  
  34.      TAPE:APP  Opens the tape after the end of the last-written file, to
  35.         allow you to append a file to a tape with existing files.
  36.         This mode is allowed only for writes (but not on 3M MCD-40 drives).
  37.         Some drives do not support this function;  in that case, BTN
  38.         will resort to a slower method which searches for a blank spot.
  39.  
  40.      TAPE:END  Same as TAPE:APP, for use with the file number tracking feature.
  41.         Unfortunately, this append mode may be slower than TAPE:APP.
  42.         See "FILE NUMBER TRACKING" section in features.doc.
  43.  
  44.      TAPE:num  Opens the tape at the position specified by the number.
  45.         For sequential drives, the number indicates the file position,
  46.         and may be used only for reading data from the tape (no writes).
  47.         TAPE:0 is the first file on the tape, TAPE:1 is the second file,
  48.         etc.  You can only read files that have been previously written.
  49.         Files are separated by one or more filemarks (automatically written
  50.         at the end of a write).  For direct access (3M) drives, the number
  51.         specifies an absolute SCSI block number on the tape.  You should
  52.         remember (write down) the first and last block number of each
  53.         file on the tape, as reported by TAPEMON.
  54.  
  55.      TAPE:POS   A special mode for reading the file number of the
  56.         current tape position, not for accessing the tape medium.
  57.         Returns a short string containing a decimal number.
  58.         See "FILE NUMBER TRACKING" in features.doc.
  59.  
  60.      TAPE:RAWCMD   A special mode for issuing a raw SCSI command, not for
  61.         accessing the tape medium.  See "RAW COMMAND INTERFACE" in features.doc.
  62.  
  63.      TAPE:MODESEL  A special mode for writing mode-select data, not for
  64.         accessing the tape medium.  See "USER-SPECIFIED MODE SELECT"
  65.         in features.doc.
  66.  
  67.  
  68. HOW TO ACCESS TAPE DATA
  69.  
  70.      Now that the handler is installed, how do you talk to it?
  71.      You can use TAR, or your own application program, including ARexx.
  72.      You can write data to the tape and later read it back in a manner
  73.      similar to other files, using DOS calls to Open, Read, Write, Seek,
  74.      and Close, or C library functions fopen, fread, fwrite, etc.
  75.      You may even copy single files to and from the tape using a
  76.      CLI COPY command:  "COPY filename TAPE:"  and   "COPY TAPE: filename"
  77.  
  78.      The handler makes the tape data look like a sequential AmigaDOS file.
  79.      There is no file system on the tape, but you may place multiple files
  80.      on a tape by appending new files after the last-written file.
  81.      The handler does not support mixed reads and writes.  That is, you may
  82.      do only Reads or only Writes, but not both.
  83.  
  84.      BTN now supports Seek() (thanks to Dennis J. Brueni),
  85.      with the following restrictions:
  86.         * Must be in fixed block mode (VB-0)
  87.         * Must be opened for Read()s
  88.         * Seeks relative to end-of-file are not allowed
  89.         * Seeks relative to current-position or beginning-of-file are
  90.            allowed provided that the net position change is:
  91.                - forward from the current position
  92.                - backward to the exact beginning of the file only,
  93.                   except if opened as TAPE:NR
  94.  
  95.      Tape data is written in quantities of "NB*BS" bytes.  If a tape file
  96.      ends before filling a block, the remainder of the block is filled with
  97.      zeroes.  Therefore, any program reading the tape must know when to
  98.      stop reading data, otherwise it will read extraneous zeroes past the
  99.      true end of the file.  This is especially true of the CLI "COPY" command.
  100.      TAR works because it essentially writes and interprets the tape data
  101.      as its own little file system that includes the length of each file.
  102.  
  103.      When a tape file is closed in write mode, one or more filemarks
  104.      (as determined by "FM") are written at the end of the file to
  105.      delineate the file from subsequent files. (Sequential drives only).
  106.  
  107.  
  108. USING TAR FOR BACKUPS AND RESTORES
  109.  
  110.      For backups, I recommend the version of TAR ported by Jonathan Hue.
  111.      It is available on Fish Disk 445 or various online sources.
  112.      It is 33860 bytes long.   Each TAR archive is written to the tape
  113.      as a single file, terminated by a file mark (on sequential drives).
  114.      NOTE: other versions of TAR, or other archiving programs may or may
  115.      not work with BTNtape- I just haven't tried them.
  116.  
  117.      TAR will backup all directories, files, and subdirectories in the
  118.      directory you specify, including the date, protection, and filenote
  119.      attributes.  The easiest way to do a backup is to CD to the desired
  120.      directory or partition (e.g. "cd DH0:"), then...
  121.  
  122.      To make a backup archive with TAR  :   tar -cvf tape: .
  123.      To add another at current position :   tar -cvf tape:nr .
  124.      To add another after last archive  :   tar -cvf tape:app .
  125.      To restore files from archive      :   tar -xvf tape: *
  126.      To restore a specific file         :   tar -xvf tape: path/filename
  127.      To restore from archive at file 6  :   tar -xvf tape:6 *
  128.      To list the archive on the tape    :   tar -tvf tape:
  129.       (this also tests archive integrity)
  130.      To make an archive log             :   tar >logfile -tvf tape:
  131.      To look at raw tape data           :   type tape: opt h
  132.  
  133.      TAR can also make backups using a list of files from another file.
  134.      When you restore an individual file from an archive, provide the
  135.      exact path and file name;  these names are case sensitive.
  136.      Refer to the TAR documentation for more information.
  137.  
  138.      You can also use BTN to read TAR tapes written on a Unix system.
  139.      Even if the tape was written in variable block mode (on a drive which
  140.      supports that mode), you can still read it using BTN, which (currently)
  141.      only does fixed block mode.  The trick is to set the block size (BS)
  142.      to the same number of bytes per block as were written on the Unix side.
  143.      This number is N*512, where N is the value of the TAR -b option,
  144.      which is usually 20, so the typical BS value is 10240.
  145.  
  146.  
  147. HELPFUL HINTS:
  148.  
  149.      Label your tapes.  Include the file number or block number
  150.      of each file on a multi-file tape.
  151.  
  152.      After doing a backup, flip the write-protect tab on the cartridge.
  153.      This helps prevent accidental erasures (like using TAR -c when you
  154.      really wanted to do TAR -x).  The AO and RO feature flags of BTN
  155.      may also be useful.
  156.  
  157.      Try backing up and restoring a floppy before doing the
  158.      same with your hard drive, to make sure the process works for you.
  159.      For the same reason, make a HD backup to floppies first.  Then
  160.      if the tape restore fails, you have something to fall back on.
  161.  
  162.      This is obvious, right?  Make sure you have a copy of the handler and
  163.      TAR on an easily-accessible floppy.  If the only copy you have is
  164.      on your hard drive, you might find it difficult to restore
  165.      from a tape backup after a disk wipe-out.
  166.  
  167.  
  168. FINE TUNING
  169.  
  170.      There are a few factors you can tweak to get good performance
  171.      on your particular system.  Good performance means the tape tends
  172.      to run continuously for long periods of time and seldom has
  173.      to stop and back up to get a running start at the next block.
  174.      (On some drives, poor performance also results in a reduction of
  175.      the amount of data you can write on the tape.)
  176.      The tape may have to stop while TAR gets more data from the
  177.      hard disk, but you can minimize it.
  178.  
  179.      The handler's NB parameter can be increased from 1 to
  180.      some larger number as your memory allows.  With more handler
  181.      blocks, a larger quantity of data is available to dump to the tape.
  182.      But beyond a certain number of blocks, there is no further advantage.
  183.  
  184.      The TAR program also has a block parameter.  It controls how much
  185.      DOS data TAR collects before sending it to the handler.  If you
  186.      use many TAR blocks, it makes no sense to also use many handler
  187.      blocks,  since the data has to go through both buffers anyway.
  188.  
  189.      Other activities going on in other tasks may slow down the tape.
  190.      Shut down non-essential programs that take CPU time or make
  191.      lots of disk accesses.
  192.  
  193.      Using the TAPEMON program may slow down the handler slightly
  194.      when it prints messages, but it's not really a problem.
  195.      If you absolutely need maximum throughput, shut down TAPEMON.
  196.  
  197.